
#include"ls.h"


int main(int argc, char *argv[])
{
    char dirPath[PATH_MAX];

    if(argc == 1)//当前目录
    { 
    	if (getcwd(dirPath, PATH_MAX) != NULL){
        	ls(dirPath);
    	}
    }
    else if(argc == 2)//参数指定的目录
    { 
    	ls(argv[1]);
    }
    else if(argc > 2)
    {
    	printf("usage: myls or myls [directory]\n");
    }
    return 0;
}
